const mysql = require('mysql');

exports.base = (sql,data,callback) => {
  const connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: '',
    database:'book',
  });
  
  connection.connect();
  connection.query(sql, data, (error, result, fieds) => {
    if (error) throw error;
    callback(result);
  });
  connection.end();
}